<template>
    <div>
        <transition name="shadow">
            <div @click="shadow_close" v-show="flag" class="shadow"></div>
        </transition>
        <transition name="content">
            <div v-show="flag" class="centent">
                <div class="content-hearder">
                    <button @click="shadow_close">取消</button>
                    <button @click="submit">确定</button>
                </div>
                <div class="select-big">
                    <div @touchmove.stop="touchmove($event, 'province')" @touchstart="touchstart"
                        @touchend.stop="touchend($event, 'province')" class="select-big-div">
                        <ul ref="province">
                            <li>1</li>
                            <li>1</li>
                            <li>1</li>
                            <li>1</li>
                            <li>1</li>
                            <li>1</li>
                        </ul>
                    </div>
                    <div class="select-bac"></div>
                    <div class="hr"></div>
                </div>
            </div>
        </transition>
    </div>
</template>
<script>
export default ({
    props: {
        flag: {
            type: false,
        },
    },
    data() {
        return {

        }
    },
    methods: {
        shadow_close() {
            this.$emit('update:flag', false)
        },
        submit() {
            this.$emit('update:flag', false)
        },
        touchstart(e) {

        },
        touchmove(e, page) {

        },
        touchend(e, page) {

        },
    },
})
</script>
<style lang="scss" scoped>
@function r($v) {
    @return $v / (390 / 10rem)
}

@function h($v) {
    @return $v / (844 / 10rem)
}

.loading .icon {
    margin-bottom: 0.3rem;
}

.loading {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.37rem;
    color: #333;
}

.hr {
    height: r(44);
    z-index: 2;
    position: absolute;
    top: 50%;
    right: 0.42667rem;
    left: 0.42667rem;
    z-index: -1;
    transform: translateY(-50%);
    border-top: 0.02667rem solid #eee;
    border-bottom: 0.02667rem solid #eee;
}

.select-big {
    height: r(264);
    position: relative;
    display: flex;
}

.select-bac {
    height: 100%;
    width: 100%;
    background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4)), linear-gradient(0deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4));
    background-size: 100% h(200);
    z-index: 1;
    position: absolute;
    left: 0;
    top: 0;
    cursor: grab;
    background-repeat: no-repeat;
    background-position: top, bottom;
    transform: translateZ(0);
    pointer-events: none;
}

.select-big-div {
    height: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.select-big>div>ul {
    transition: all 0.2s;
    list-style: none;
    position: absolute;
    left: 0;
    width: 100%;
    top: r(110);
}

.select-big>div>ul>li {
    line-height: r(44);
    text-align: center;
    color: #000;
    font-size: r(16);
}

.content-hearder button {
    height: 100%;
    padding: 0 0.42667rem;
    font-size: 0.37333rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #969799;
}

.content-hearder {
    display: flex;
    height: 1.17333rem;
    justify-content: space-between;
}

.bgc {
    background-color: #eee;
}

.bgc input {
    background-color: #eee;
}

.content-enter-active {
    animation: content 0.3s linear;
}

.content-leave-active {
    animation: content 0.3s linear reverse;
}

@keyframes content {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.centent {
    transition: all 0.3s;
    width: 100%;
    background-color: #fff;
    position: fixed;
    bottom: 0%;
    left: 0;
    z-index: 1002;
    overflow: hidden;
    border-radius: 0.426rem 0.462rem 0 0;
}

.shadow-enter-active {
    animation: shadow 0.3s linear;
}

.shadow-leave-active {
    animation: shadow 0.3s linear reverse;
}

@keyframes shadow {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.shadow {
    width: 100%;
    height: 100%;
    position: fixed;
    background-color: #0000008d;
    top: 0;
    left: 0;
    z-index: 1001;
}

.icon {
    font-weight: bold;
}

.right-1 {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
}

.right-input {
    border: none;
    outline: none;
    font-size: 0.37rem;
    flex: 1%;
    transition: all 0.05s;
}

input::placeholder {
    font-size: 0.37rem;
    color: #999;
}

.big {
    padding: 0.26rem 0.42rem;
    margin: 0 0.32rem;
    border-bottom: 1px solid #eee;
    display: flex;
    line-height: 0.64rem;
    transition: all 0.05s;
}

.left {
    margin-right: 0.32rem;
    width: 4.1em;
    font-size: 0.37rem;
}

.right {
    flex: 1;
}
</style>